<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>My Engine: my::Timer Class Reference</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />

<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">My Engine
   
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><b>my</b>      </li>
      <li class="navelem"><a class="el" href="classmy_1_1_timer.html">Timer</a>      </li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a>  </div>
  <div class="headertitle">
<div class="title">my::Timer Class Reference</div>  </div>
</div>
<div class="contents">
<!-- doxytag: class="my::Timer" -->
<p>Create a <a class="el" href="classmy_1_1_timer.html" title="Create a Timer. A Timer is a watch that starts at a given time and that decrease to reach zero...">Timer</a>. A <a class="el" href="classmy_1_1_timer.html" title="Create a Timer. A Timer is a watch that starts at a given time and that decrease to reach zero...">Timer</a> is a watch that starts at a given time and that decrease to reach zero.  
 <a href="classmy_1_1_timer.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="_timer_8h_source.html">Timer.h</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for my::Timer:</div>
<div class="dyncontent">
 <div class="center">
  <img src="classmy_1_1_timer.png" usemap="#my::Timer_map" alt=""/>
  <map id="my::Timer_map" name="my::Timer_map">
<area href="classmy_1_1_triggering_timer.html" title="Create a TriggeringTimer. A TriggeringTimer is a Timer that call a binded slot (function or class mem..." alt="my::TriggeringTimer" shape="rect" coords="0,56,123,80"/>
</map>
 </div></div>

<p><a href="classmy_1_1_timer-members.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="adc72cfa80da51da3be9d096f0b7e2194"></a><!-- doxytag: member="my::Timer::Timer" ref="adc72cfa80da51da3be9d096f0b7e2194" args="()" -->
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmy_1_1_timer.html#adc72cfa80da51da3be9d096f0b7e2194">Timer</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Default Constructor. To use the <a class="el" href="classmy_1_1_timer.html" title="Create a Timer. A Timer is a watch that starts at a given time and that decrease to reach zero...">Timer</a> you will need to use <a class="el" href="classmy_1_1_timer.html#a89251f4fb94c50022d9ef0ce103716ff" title="To reset the Timer.">reset(float timeLimit, bool continueRunning)</a>. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmy_1_1_timer.html#acd6730aa46a791435db7e4dcc7299bfd">Timer</a> (float timeLimit, bool initRunning=false)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Recommended constructor.  <a href="#acd6730aa46a791435db7e4dcc7299bfd"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ad8a257017aeb9059476afa0c7ac97dc7"></a><!-- doxytag: member="my::Timer::~Timer" ref="ad8a257017aeb9059476afa0c7ac97dc7" args="()" -->
virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmy_1_1_timer.html#ad8a257017aeb9059476afa0c7ac97dc7">~Timer</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Default destructor. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmy_1_1_timer.html#a5f2c41bea1132f90537a3f6f04c676bc">getRemainingTime</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the time remaining to reach zero, or zero if the reamining timer is over.  <a href="#a5f2c41bea1132f90537a3f6f04c676bc"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmy_1_1_timer.html#a9c18a5bf65b1c71d71732a18da961866">isRunning</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Return if the <a class="el" href="classmy_1_1_timer.html" title="Create a Timer. A Timer is a watch that starts at a given time and that decrease to reach zero...">Timer</a> is running or not.  <a href="#a9c18a5bf65b1c71d71732a18da961866"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmy_1_1_timer.html#a02b0fa5fec771fa982194a7fb00c92f0">isExpired</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Return if the <a class="el" href="classmy_1_1_timer.html" title="Create a Timer. A Timer is a watch that starts at a given time and that decrease to reach zero...">Timer</a> is expired or not.  <a href="#a02b0fa5fec771fa982194a7fb00c92f0"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a515e829067c5630fcc2d35a36b5bcc48"></a><!-- doxytag: member="my::Timer::start" ref="a515e829067c5630fcc2d35a36b5bcc48" args="()" -->
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmy_1_1_timer.html#a515e829067c5630fcc2d35a36b5bcc48">start</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">To start the <a class="el" href="classmy_1_1_timer.html" title="Create a Timer. A Timer is a watch that starts at a given time and that decrease to reach zero...">Timer</a>. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a314d9afded21f4cb94339caa36aac992"></a><!-- doxytag: member="my::Timer::stop" ref="a314d9afded21f4cb94339caa36aac992" args="()" -->
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmy_1_1_timer.html#a314d9afded21f4cb94339caa36aac992">stop</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">To stop the <a class="el" href="classmy_1_1_timer.html" title="Create a Timer. A Timer is a watch that starts at a given time and that decrease to reach zero...">Timer</a>. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmy_1_1_timer.html#a89251f4fb94c50022d9ef0ce103716ff">reset</a> (float timeLimit, bool continueRunning=false)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">To reset the <a class="el" href="classmy_1_1_timer.html" title="Create a Timer. A Timer is a watch that starts at a given time and that decrease to reach zero...">Timer</a>.  <a href="#a89251f4fb94c50022d9ef0ce103716ff"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmy_1_1_timer.html#accc5932c402ba5fd4ab65460d9d44f2a">reset</a> (bool continueRunning=false)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">To reset the <a class="el" href="classmy_1_1_timer.html" title="Create a Timer. A Timer is a watch that starts at a given time and that decrease to reach zero...">Timer</a>, the old time limit will be kept.  <a href="#accc5932c402ba5fd4ab65460d9d44f2a"></a><br/></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>Create a <a class="el" href="classmy_1_1_timer.html" title="Create a Timer. A Timer is a watch that starts at a given time and that decrease to reach zero...">Timer</a>. A <a class="el" href="classmy_1_1_timer.html" title="Create a Timer. A Timer is a watch that starts at a given time and that decrease to reach zero...">Timer</a> is a watch that starts at a given time and that decrease to reach zero. </p>
<div class="fragment"><pre class="fragment"><a class="code" href="classmy_1_1_timer.html" title="Create a Timer. A Timer is a watch that starts at a given time and that decrease to reach zero...">my::Timer</a> timer(5.f); <span class="comment">// Create a timer of 5.0 seconds</span>
timer.start(); <span class="comment">// Start the timer</span>
<span class="keywordflow">while</span>(!timer.isExpired())
{
    <span class="comment">// While the timer is not expired</span>
    <span class="comment">// Do something...</span>
}
</pre></div> </div><hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="acd6730aa46a791435db7e4dcc7299bfd"></a><!-- doxytag: member="my::Timer::Timer" ref="acd6730aa46a791435db7e4dcc7299bfd" args="(float timeLimit, bool initRunning=false)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">my::Timer::Timer </td>
          <td>(</td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>timeLimit</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>initRunning</em> = <code>false</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Recommended constructor. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">timeLimit</td><td>The starting time of the <a class="el" href="classmy_1_1_timer.html" title="Create a Timer. A Timer is a watch that starts at a given time and that decrease to reach zero...">Timer</a>. It will decrease to zero. </td></tr>
    <tr><td class="paramname">initRunning</td><td>Set it true if you want to start the timer at construction </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="a5f2c41bea1132f90537a3f6f04c676bc"></a><!-- doxytag: member="my::Timer::getRemainingTime" ref="a5f2c41bea1132f90537a3f6f04c676bc" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">float my::Timer::getRemainingTime </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Return the time remaining to reach zero, or zero if the reamining timer is over. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>The remaining time, in seconds, or zero if timer is expired </dd></dl>

</div>
</div>
<a class="anchor" id="a02b0fa5fec771fa982194a7fb00c92f0"></a><!-- doxytag: member="my::Timer::isExpired" ref="a02b0fa5fec771fa982194a7fb00c92f0" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool my::Timer::isExpired </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Return if the <a class="el" href="classmy_1_1_timer.html" title="Create a Timer. A Timer is a watch that starts at a given time and that decrease to reach zero...">Timer</a> is expired or not. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>true if expired, else false </dd></dl>

</div>
</div>
<a class="anchor" id="a9c18a5bf65b1c71d71732a18da961866"></a><!-- doxytag: member="my::Timer::isRunning" ref="a9c18a5bf65b1c71d71732a18da961866" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool my::Timer::isRunning </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Return if the <a class="el" href="classmy_1_1_timer.html" title="Create a Timer. A Timer is a watch that starts at a given time and that decrease to reach zero...">Timer</a> is running or not. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>true if running, else false </dd></dl>

</div>
</div>
<a class="anchor" id="a89251f4fb94c50022d9ef0ce103716ff"></a><!-- doxytag: member="my::Timer::reset" ref="a89251f4fb94c50022d9ef0ce103716ff" args="(float timeLimit, bool continueRunning=false)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void my::Timer::reset </td>
          <td>(</td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>timeLimit</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>continueRunning</em> = <code>false</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>To reset the <a class="el" href="classmy_1_1_timer.html" title="Create a Timer. A Timer is a watch that starts at a given time and that decrease to reach zero...">Timer</a>. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">timeLimit</td><td>The starting time of the <a class="el" href="classmy_1_1_timer.html" title="Create a Timer. A Timer is a watch that starts at a given time and that decrease to reach zero...">Timer</a>. It will decrease to zero. </td></tr>
    <tr><td class="paramname">continueRunning</td><td>Set it true if you want to restart the timer </td></tr>
  </table>
  </dd>
</dl>

<p>Reimplemented in <a class="el" href="classmy_1_1_triggering_timer.html#aa3d081edf90ddb62d3af0c41fea39ed1">my::TriggeringTimer</a>.</p>

</div>
</div>
<a class="anchor" id="accc5932c402ba5fd4ab65460d9d44f2a"></a><!-- doxytag: member="my::Timer::reset" ref="accc5932c402ba5fd4ab65460d9d44f2a" args="(bool continueRunning=false)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void my::Timer::reset </td>
          <td>(</td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>continueRunning</em> = <code>false</code></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>To reset the <a class="el" href="classmy_1_1_timer.html" title="Create a Timer. A Timer is a watch that starts at a given time and that decrease to reach zero...">Timer</a>, the old time limit will be kept. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">continueRunning</td><td>Set it true if you want to restart the timer </td></tr>
  </table>
  </dd>
</dl>

<p>Reimplemented in <a class="el" href="classmy_1_1_triggering_timer.html#a6ec4744e75c4b1550e9a7e4500aaa941">my::TriggeringTimer</a>.</p>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>Time/<a class="el" href="_timer_8h_source.html">Timer.h</a></li>
<li>Timer.cpp</li>
</ul>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Functions</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>



<hr class="footer"/><address class="footer"><small>
Generated on Fri Nov 18 2011 22:34:34 for My Engine by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.5.1
</small></address>

</body>
</html>
